class AdvancedCalculator {
  def calculate(x: Int, y: Int, op: Char): Any = op match {
    case '+' => x + y
    case '-' => x - y
    case '*' => x * y
    case '/' => if (y != 0) x / y else "Division by zero"
    case _   => "Invalid operator"
  }
}

//测试
  val advCalculator = new AdvancedCalculator()
  println(advCalculator.calculate(10, 5, '+'))
  println(advCalculator.calculate(10, 5, '-'))
  println(advCalculator.calculate(10, 5, '*'))
  println(advCalculator.calculate(10, 5, '/'))
  println(advCalculator.calculate(10, 5, '%'))